import checkCreative  from '@/components/creativity/check-creative/index'
export default {
  name: 'setCreative',
  components:{
	checkCreative
  },
  mounted(){
		let arr=JSON.parse(this.$route.query.campaignId);
	  this.campaignId=arr;
  },
  data () {
  	 return {
		campaignId:[],
		checkboxModal:[],
		creativeSureLoading:false
	 }
  },
  watch:{ 
  },
  methods:{
	creativeSure(){
		  if(this.creativeSureLoading){
				  return false;
			}
		  let _this=this;
		  let data={
			campaign_id:this.campaignId,
			creative_id_list:this.checkboxModal
			};
			this.creativeSureLoading=true;
		  this.$http({
			method: 'post',
			url: '/zuanzhan/creative/batch-bind',
			data: data,
		  }).then((data) => {
				this.creativeSureLoading=false;
				this.$message.success('操作成功');
				sessionStorage.removeItem('campaign');
				this.$router.push('/planList');
		  })
		  .catch(function (error) {
				_this.creativeSureLoading=false;
		  });
	  }
  }
}


























